package com.zjp.nio.nio;


import java.io.IOException;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;

/**
 * nio通信服务端处理器
 */
public class NioServerHandleWriteable implements Runnable {


    private Selector selector;

    private ServerSocketChannel serverSocketChannel;

    private volatile boolean started;


    public NioServerHandleWriteable(int port) {
        try {
            // 创建选择器
            selector = Selector.open();
            // 打开监听通道
            serverSocketChannel = ServerSocketChannel.open();
            // 如果为 true，则此通道将被置于阻塞模式；
            // 如果为 false，则此通道将被置于非阻塞模式
            serverSocketChannel.configureBlocking(false);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void run() {

    }
}
